// 商品相关的请求 API

import http from './request';

// 查询商品   // product/list
const getProductList = (params: IProductListParams): PRES<IProductListModel> => http.get('product/list', { params });

// 批量修改商品的  删除状态(批量删除)   // product/update/deleteStatus
const updateDeleteStatus = (params: IDeleteStatusParams): PRES<number> => http.post(`product/update/deleteStatus?ids=${params.ids}&deleteStatus=${params.deleteStatus}`);


// 批量上下架     // product/update/publishStatus
const updatePublishStatus = (params: IPublishStatusParams): PRES<number> => http.post(`product/update/publishStatus?ids=${params.ids}&publishStatus=${params.publishStatus}`);


// 批量推荐商品   // product/update/recommendStatus
const updateRecommendStatus = (params: IRecommendStatusParams): PRES<number> => http.post(`product/update/recommendStatus?ids=${params.ids}&recommendStatus=${params.recommendStatus}`);


// 批量设为新品   // product/update/newStatus
const updateNewStatus = (params: INewStatusParams): PRES<number> => http.post(`product/update/newStatus?ids=${params.ids}&newStatus=${params.newStatus}`);


// 



// 导出 
export {
  getProductList,
  updateDeleteStatus,
  updatePublishStatus,
  updateRecommendStatus,
  updateNewStatus,
}